package interviewpreparationkit.array

import org.junit.jupiter.api.Test
import java.util.*
import kotlin.test.assertEquals

class MinimumSwapsTests {
    @Test
    fun minimumSwapsTest() {
        val scan = Scanner(this.javaClass.getResourceAsStream("/minimumSwaps.txt"))

        while (scan.hasNextLine()) {
            val n = scan.nextLine().trim().toInt()

            val arr = scan.nextLine().split(" ").map { it.trim().toInt() }.toTypedArray()

            val res = minimumSwaps(arr)

            println(res)
            assertEquals(scan.nextLine().trim().toInt(), res)
        }
    }
}